<?php

// 本类由系统自动生成，仅供测试用途
class TagsAction extends PublicAction {

        public function _initialize() {



                $this->assign('volunteerList', $this->getMemberList(10));
        }

        public function lists() {



                $tags_info = ToolsAction::TopTags(100);

                //P($tags_info);
                
                
                $this->assign('lists', $tags_info);

/*
                $db = M('tags');

// 进行分页数据查询 注意limit方法的参数要使用Page类的属性

                import('ORG.Util.Page'); // 导入分页类
                $count = $db->group('tags_item_title')->count(); // 查询满足要求的总记录数
                $Page = new Page($count, 50); // 实例化分页类 传入总记录数和每页显示的记录数
                $show = $Page->show(); // 分页显示输出




                $lists = $db->group('tags_item_title')->limit($Page->firstRow . ',' . $Page->listRows)->select();
                
                
               $this->assign('lists', $lists);
                
                
                $this->assign('page', $show); // 赋值分页输出
                
               */



                $this->display();
        }
        
        
        
        /****

         * 
         * 
         * <?php

// 本类由系统自动生成，仅供测试用途
class TagAction extends PublicAction {

        public function _initialize() {

                $this->assign('DonateList', $this->getDonateList());
        }

        public function index() {



                $tagsDB = M('tags');



                $alltagsNumbers = $tagsDB->count();

                $list = $tagsDB->getField('tags_item_title', TRUE);

                $list = array_unique($list);




                foreach ($list as $k => $v) {


                        $where['tags_item_title'] = $list[$k];
                        $numbers = $tagsDB->where($where)->count();

                        $tags_info[$k]['title'] = $v;
                        $tags_info[$k]['articleNumbers'] = $numbers;



                        $tags_info[$k]['percent'] = round(($numbers / $alltagsNumbers) * 100, 1);
                }









                $this->assign('tagslist_info', $tags_info);



                $this->display();
        }

        public function lists() {


                $tags_info = ToolsAction::TopTags(100);

                $this->assign('tagslist_info', $tags_info);




                $this->display();
        }

}

?>

         * 
         * 
         * 
         * 
         * 
         * 
         * 
         * 
         *          /
         */
        
        
        
        
        
        
        
        
        
        
        
        

}

?>